.PHONY: gen-go package

IMAGE_NAME=protos
VERSION=v0.0.1
GIT_COMMIT=$(shell git rev-parse HEAD)

default: gen-proto

package:
	docker build --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=${GIT_COMMIT} -t ${IMAGE_NAME}:${VERSION} .

push: package
	docker push ${IMAGE_NAME}:${VERSION}

gen-proto: clean
	mkdir -p ./import/demo/
	docker run --rm -it -v `pwd`:/opt/protos ${IMAGE_NAME}:${VERSION} sh gen.sh proto
	rm -rf   ./import/demo/

gen-mock:
	@rm -rf gooutmock
	sh gen.sh mock

clean:
	rm -rf   ./import/demo/
